package com.genius.smsweb.coursemanage;

import com.genius.smsbase.Controller.GenericController;
import com.genius.smsbase.Domain.Result;
import com.genius.smsdao.coursemanage.domain.Course;
import com.genius.smsservice.coursemanage.service.CourseManager;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "课程管理-课程", description = "CourseController")
@RestController
@RequestMapping(value = "course")
public class CourseController extends GenericController<Course,Long, CourseManager> {

    CourseManager courseManager;

    @Autowired
    public void setCourseManager(CourseManager courseManager){
        this.courseManager = courseManager;
        this.manager = this.courseManager;
    }

    /**
     *
     * @param student_number
     * @param course_name
     * @return Result
     */
    @RequestMapping(value = "/add2",method = RequestMethod.GET)
    public Result addstudent(String student_number, String course_name){
        return courseManager.add_student(student_number,course_name);
    }

    /**
     *
     * @param student_number
     * @param course_name
     * @return Result
	 * @Created by gpf
     */
    @RequestMapping(value = "/del",method = RequestMethod.DELETE)
    public Result delstudent(String student_number,String course_name){
        return courseManager.del_student(student_number,course_name);
    }
}
